home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / src / plugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-23  |  3.0 KB  |  101 lines

  1. /* plugin.h- plugin
  2.  *
  3.  *  Window Maker window manager
  4.  *
  5.  *  Copyright (c) hmmm... Should I put everybody's name here?
  6.  *  Where's my lawyer?? -- ]d :D
  7.  *
  8.  *  This program is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2 of the License, or
  11.  *  (at your option) any later version.
  12.  *
  13.  *  This program is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with this program; if not, write to the Free Software
  20.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
  21.  *  USA.
  22.  * 
  23.  * * * * * * * * *
  24.  * Do you think I should move this code into another file? -- ]d
  25.  *
  26.  * BTW, should this file be able to be included by any plugin file that
  27.  * want _DL ?
  28.  */
  29.  
  30.  
  31. #ifndef WMPLUGIN_H
  32. #define WMPLUGIN_H
  33.  
  34. #include "wconfig.h"
  35.  
  36. #include <WINGs.h>
  37. #include <proplist.h>
  38.  
  39. #define W_FUNCTION_ANY 0
  40. #define W_FUNCTION_DRAWSTRING 1
  41.  
  42. typedef void _DL_AnyProc(proplist_t);
  43.  
  44. /* first 3 must == WS_FOCUSED WS_UNFOCUSED WS_PFOCUSED -- ]d */
  45. #ifdef DRAWSTRING_PLUGIN
  46. #define W_STRING_FTITLE 0
  47. #define W_STRING_UTITLE 1
  48. #define W_STRING_PTITLE 2
  49. #define W_STRING_MTITLE 3
  50. #define W_STRING_MTEXT  4
  51. #define W_STRING_MEMBERS 5
  52.  
  53. typedef void _DL_DrawStringProc(proplist_t, Drawable, GC, WMFont *, int, int, unsigned, unsigned, char *, int);
  54. #endif
  55.  
  56. typedef void _DL_FreeDataProc(void *free_me);
  57.  
  58. typedef int _DL_InitDataProc(proplist_t pl, void *init_data); /* prototype
  59.                                                                  for function
  60.                                                                  initializer
  61.                                                                  */
  62.  
  63. typedef struct _WFunction {
  64.     int type;
  65.     void *handle;
  66.     proplist_t arg;
  67.     void *data;
  68.     _DL_FreeDataProc *freeData;
  69.     union {
  70.         _DL_AnyProc *any;
  71. #ifdef DRAWSTRING_PLUGIN
  72.         _DL_DrawStringProc *drawString;
  73. #endif
  74.     } proc;
  75.     /*
  76.     char *libraryName;
  77.     char *procName;
  78.     char *freeDataProcName;
  79.     */
  80. } WFunction;
  81.  
  82. /* for init_data, pass something like 
  83.  * p = wmalloc(sizeof(void *) * 3)
  84.  * and let p[0]=display p[1]=colormap p[2]=cache (for keeping local data
  85.  * for each instance of function in each WFunction) to the initializing
  86.  * code for drawstring function... may be I can change this to a variable
  87.  * packer function? or use va_list? I dunno...
  88.  *
  89.  * --]d
  90.  */
  91.  
  92. WFunction* wPluginCreateFunction(int type, char *library_name,
  93.         char *init_proc_name, char *proc_name, char *free_data_proc_name,
  94.         proplist_t pl_arg, void *init_data);
  95.  
  96. void wPluginDestroyFunction(WFunction *function);
  97.  
  98. void** wPluginPackInitData(int members, ...);
  99.  
  100. #endif
  101.